<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
<input type="text" v-model="num" placeholder="输入数字">
<input type="button" value="猜一猜" v-on:click="f()">
<h1>{{info}}</h1>
</div>
<script src="js/vue.min.js"></script>
<script>
  let ran=parseInt(Math.random()*100+1);
  console.log(ran);
    let v=new Vue({
        el:"body>div",
        data:{
            info:"",
            num:""
        },
        methods:{
            f(){
                if(v.num>ran){
                    v.info="大了";
                }else if(v.num<ran){
                    v.info="小了";
                }else {
                    v.info="对了";
                }
            }
        }
    })
</script>
</body>
</html>